package com.physique.tea.Service.Impl;

import com.physique.tea.Global.Result;
import com.physique.tea.Global.ResultList;
import com.physique.tea.Mapper.HistoryMapper;
import com.physique.tea.Pojo.History;
import com.physique.tea.Service.HistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HistoryServiceImpl implements HistoryService {

    @Autowired
    HistoryMapper historyMapper;

    @Override
    public Result getHistoryByUsername(String username) {
        List<History> histories = historyMapper.selectByUsername(username);
        return new Result(ResultList.SUCCESS.getCode(),
                ResultList.SUCCESS.getMessage(),
                histories);
    }
}
